function s() {
	let tr = document.querySelectorAll('#table .tr')
	let allCount = document.querySelector('#allCount')
	let allCountNum = 0

	for(let i = 0; i < tr.length; i++) {
		var price = tr[i].children[2].children[0].innerHTML
		var num = tr[i].children[3].children[0].value
		var count = tr[i].children[4].children[0].innerHTML = (price * num).toFixed(2)
		allCountNum += Number(count)
	}
	allCount.innerHTML = allCountNum.toFixed(2)
}
s()

let ipt = document.querySelectorAll('#table .num')
for (let j = 0; j<ipt.length;j++) {
	ipt[j].addEventListener('change',s)
}

let del = document.querySelectorAll('.del')
for (let k = 0;k<del.length;k++) {
	del[k].addEventListener('click',function(){
		console.log(this.parentNode)
		var tbody = document.querySelector('#table tbody')
		console.log(tbody)
		tbody.removeChild(this.parentNode)
		s()
	})
}